<#import "/macro.ftl" as m>
<@m.page_header title='后台' />
<div id="page-content-wrapper">

<div id="page-title">

    <h3>
        <#if safeguardmedium>修改媒体机构<#else>添加媒体机构</#if>
    </h3>
 
</div>
<div class="pad10A">
<#if safeguardmedium> 
<form id="demo-form1" action="/safeguardmedium/safeguardmediumupdate/${safeguardmedium.id}" class="col-md-12" method="POST">
<#else>
<form id="demo-form1" action="/safeguardmedium/safeguardmediumadd" class="col-md-12" method="POST">
</#if>

	<#if safeguardmedium>
	<input type="hidden" name="id" value="${safeguardmedium.id}"/>
	</#if>
   <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                媒体:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-8">
            <input type="text" id="medium" name="medium" data-trigger="change" data-required="true" class="parsley-validated" value="${safeguardmedium.medium}">
        </div>
    </div>
    
    <div class="form-row">
	    <div class="form-label col-md-2">
	        <label for="">
	            logo:
	            <span class="required">*</span>
	        </label>
	    </div>
	    <div class="form-input col-md-8">
	    	<div class="row">
				<div class="col-md-8">
                      <input type="text" id="logo" name="logo" data-trigger="change" data-required="true" class="parsley-validated" value="">
                </div>
                <div class="form-label col-md-2">
                      <a id="logoUpload" class="btn medium primary-bg radius-all-4">
                            <span class="button-content">上传图片</span>
                      </a>
                </div>
            </div>
	    </div>
	</div>
    
    <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                排序号:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-2">
           <input type="text" id="sequence" name="sequence" data-type="number" data-trigger="change" class="parsley-validated" value="${safeguardmedium.sequence}">
        </div>
    </div>
      <div class="form-row">
        <div class="form-label col-md-2">
            <label for="">
                是否置顶:
                <span class="required">*</span>
            </label>
        </div>
        <div class="form-input col-md-2">
            <select name="isTop">
        		<option value="1" <#if safeguardmedium.isTop>selected</#if>>是</option>
        		<option value="0" <#if !safeguardmedium.isTop>selected</#if>>否</option>
        	</select>
        </div>
    </div>
    
    <div class="divider"></div>
    <div class="form-row">
        <input type="hidden" name="superhidden" id="superhidden">
       <div class="form-input col-md-10 col-md-offset-2">
                    <a href="javascript:;" class="btn medium primary-bg radius-all-4 col-md-2" id="demo-form-2-valid">
                        
                                                                         提交
                        
                 </a>
        </div>
    </div>   

</form>
</div>
</div>

<script type="text/javascript" src="/assets/js/md5.js"></script>
<script type="text/javascript" src="/assets/js/hejiauploadimage.js"></script>
<script type="text/javascript">

$("#logoUpload").click(function(){
     $(this).addMyUpload("upload/images/safeguardmedium/");
});

$(function(){
	$("#demo-form-2-valid").click(function(){
		$('#demo-form1').parsley('validate');
	    $('#demo-form1').trigger('submit');
	});
});

</script>